import org.junit.Test;
import junit.framework.TestCase;

public class StringBufferDemotest extends TestCase {
    StringBuffer jh = new StringBuffer("nxy and jh");
    StringBuffer nxy = new StringBuffer("nxy and jh danthony nb");
    public void testcharat() {
        assertEquals('n', jh.charAt(0));
        assertEquals('n', nxy.charAt(0));
    }
    public void testcapacity() {
        assertEquals(26, jh.capacity());
        assertEquals(38, nxy.capacity());
    }
    public void testlength() {
        assertEquals(10, jh.length());
        assertEquals(22, nxy.length());
    }
    public void testindexof() {
        assertEquals(0, jh.indexOf("nxy"));
        assertEquals(20,nxy.indexOf("nb"));
    }
}